<template>
	<view>
		<navbar title="设置" :autoBack="true"></navbar>
		<view class="con">
			<view class="box1">
				<view class="box1__list">
					<view class="box1__list__item" v-for="(item,index) in list" :key="index" @click="clickto(item.url)">
						<view class="box1__list__item__iconbox">
							<image :src="item.icon" class="box1__list__item__iconbox__icon"
								:style="{width:item.w,height:item.h}" mode=""></image>
						</view>
						<view class="box1__list__item__text u-flex u-flex-y-center u-flex-between"
							:class="index==(list.length-1)?'bb0':''">
							{{item.text}}
							<image src="/static/personal/more2.png" style="width: 12rpx;height: 22rpx;" mode=""></image>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
						icon: '/static/personal/tuichu.png',
						text: '退出登录',
						w: '41rpx',
						h: '41rpx',
						url: 'loginout'
					},
				],
			};
		},
		methods:{
			clickto(url) {
				if (url == 'loginout') {
					uni.showModal({
						title: '提示',
						content: '确定要退出登录？',
						success(r) {
							if (r.confirm) {
								uni.removeStorageSync('dkuserinfo')
								uni.removeStorageSync('dktoken')
								uni.reLaunch({
									url: '/pages/index/login'
								})
							}
						}
					})
				} else {
					this.navto('/pages/personal/' + url)
				}
			}
		}
	}
</script>

<style lang="scss">
	.con {
		position: relative;
		padding: 20rpx 30rpx 50rpx;

	}
	.box1 {
		background: #FFFFFF;
		border-radius: 20rpx;
	
		&__list {
			&__item {
				display: flex;
				align-items: center;
				height: 130rpx;
	
				&__iconbox {
					width: 92rpx;
					display: flex;
					justify-content: flex-end;
	
					&__icon {
						margin-right: 20rpx;
	
					}
				}
	
				&__text {
					flex: 1;
					height: 130rpx;
					padding-right: 36rpx;
					border-bottom: 1rpx solid #ECECEC;
					font-family: PingFang SC;
					font-weight: 500;
					font-size: 24rpx;
					color: #212121;
				}
			}
		}
	}
</style>